/*
 * @Date: 2021-08-15 23:11:38
 * @LastEditors: wangjun haodreams@163.com
 * @LastEditTime: 2025-05-08 15:42:33
 * @FilePath: \golib\js\jstask\boss.go
 * @Description:
 */
package taskjs

var boss *Boss

type Jober interface {
	GetTasks() []*Task
}

type Boss struct {
	Job Jober
}

// GetTasks 获取所有的任务
func GetTasks() []*Task {
	if boss == nil {
		return nil
	}
	return boss.Job.GetTasks()
}

//复位所有任务的ready状态
func SetReady() {
	for _, task := range GetTasks() {
		task.SetReady()
	}
}
